<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  
  <!--<script src="/socket/socket.io.js"></script>-->
</head>
<body>
  <script type="module">
    //import { io } from "https://cdn.socket.io/4.3.2/socket.io.esm.min.js";
    import { io } from "/socket/socket.io.esm.min.js";
    const socket = io("http://127.0.0.1:19967")
    //const socket = io("http://s1.zhiboxiu.com.cn:19967/")
	
    // 与服务器连接成功
    socket.on('connect',() => {
      console.log('socket链接成功！'+socket.id)
    })
	
    // 向服务器发送消息
    socket.emit('sendToServer',{
      message:'我是客户端,来陪我聊聊'
    })
	
	
	
	// 向服务器发送消息
    socket.on('sendToServer',{
		mobileid :"596D0E01-310B-44DC-B805-1222",
		roomnum : 1066,
		stream : "1066_1700822019",
		token : "d2924fc12f9c9e45b158ec92984e2673",
		uid : 1071,
		username : "\U65e0\U6781",
    })
	
    // 接收服务器发送的消息
    socket.on('sendToClient',(message) => {
      console.log(message)
    })
  </script>
</body>
</html>
